import request from '@/utils/request'

// 获取企业管理列表
export function getEnterpriseAPI(params) {
  return request({
    url: '/park/enterprise',
    params
  })
}
// 获取企业所属行业列表
export function getIndustryAPI() {
  return request({
    url: '/park/industry'
  })
}
// 添加租赁合同
export function uploadAPI(data) {
  return request({
    url: '/upload', // 上传接口
    method: 'post',
    data

  })
}
// 提交表单
export function createExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}
// 编辑企业
export function updateExterpriseAPI(data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}
// 回填表单
export function getEnterpriseDetailAPI(id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}
// 删除企业
export function delExterpriseAPI(id) {
  return request({
    url: `park/enterprise/${id}`,
    method: 'DELETE'
  })
}
// 获取楼宇数据
export function getRentBuildListAPI() {
  return request({
    url: '/park/rent/building'
  })
}
// 创建合同
export function createRentAPI(data) {
  return request({
    url: 'park/enterprise/rent',
    method: 'POST',
    data
  })
}
// 获取合同列表
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}
// 退租合同
export function delRentAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'put'
  })
}
/**
 * 获取详情
 * @param {企业id} id
 * @returns
 */
export function getEnterpriseDetail(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}
